package com.zy.order.controller;

import com.zy.userfeign.feign.UserFeign;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * description
 *
 * @author ZY
 * @date 2021年01月22日 11:38
 **/
@RestController
@RequestMapping("/api")
public class TestStandaloneFeignController {

    /**
     * 使用独立的feign测试
     */
    @Resource
    private UserFeign userFeign;

    @GetMapping("/test1")
    public Map<String, Object> test1() {
        System.out.println("测试成功");
        Map<String, Object> params = new HashMap<>(3);
        params.put("userId", "xxxxx");
        params.put("username", true);
        params.put("address", true);
        return userFeign.getUserInfo(params);
    }

}
